import re
import json


def outputInfo(type, value, spider):
    s = json.dumps({
        'type': type,
        'value': value
    })
    spider.logger.info(f'customJson{s}')


pattern = re.compile("[\u4e00-\u9fa5]")


def extract_chinese(txt):
    return ''.join(re.findall(pattern, txt))
